import config from "@/config"
import http from "@/utils/request"

export default {
	getTreeList: {
		url: `${config.API_URL}/api/Department/GetDepartmentTreeList`,
		name: "根据关键字获取对应的部门树状列表",
		get: async function(data={}){
			return await http.get(this.url, data);
		}
	},
	getList: {
		url: `${config.API_URL}/api/Department/GetDepartmentList`,
		name: "获取部门列表",
		get: async function(data={}){
			return await http.get(this.url, data);
		}
	},
	getDepartment: {
		url: `${config.API_URL}/api/Department/GetDepartment`,
		name: "根据单个部门信息",
		get: async function(data={}){
			return await http.get(this.url, data);
		}
	},
	create: {
		url: `${config.API_URL}/api/Department/Create`,
		name: "创建部门信息",
		post: async function(data={}){
			return await http.post(this.url, data);
		}
	},
	update: {
		url: `${config.API_URL}/api/Department/Update`,
		name: "编辑部门信息",
		put: async function(data={}){
			return await http.put(this.url, data);
		}
	},
	updateDepartmentUser: {
		url: `${config.API_URL}/api/Department/UpdateDepartmentUser`,
		name: "更新部门-用户信息",
		put: async function(data={}){
			return await http.put(this.url, data);
		}
	},
	deleteById: {
		url: `${config.API_URL}/api/Department/DeleteById`,
		name: "根据Id删除部门信息",
		delete: async function(data={}){
			return await http.delete(this.url, data);
		}
	},
	deleteUserDepartment: {
		url: `${config.API_URL}/api/Department/DeleteUserDepartment`,
		name: "删除指定的用户-部门关系",
		delete: async function(data={}){
			return await http.delete(this.url, data);
		}
	}
	
}
